﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="InBox.aspx.cs" Inherits="Task_InBox" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>

<%@ Register src="../Task/ucSearchTask.ascx" tagname="ucSearchTask" tagprefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>我的任务</title>
    <link href="../css/f_css.css" rel="stylesheet" type="text/css" />
    <link href="../css/listpage.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript" src="../js/jquery-1.2.6.pack.js"></script>
    <script language="javascript" src="../js/subMsg.js" type="text/javascript"></script>
    <script language="javascript" src="../js/common.js" type="text/javascript"></script>
    <script language="javascript" src="../js/qmailDataGrid.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        createQMailObj("8", "200px", "ShowTaskSimple.aspx");
        var searchBox = new WaterMarkTextBox(getx("txtSearch"), "查找...");
        $(document).ready(
            function() {
                searchBox.init();
            }
        );
    </script>
    <script language="javascript" type="text/javascript">
         function preCheckItems(gvID, confimrMsg) {
            if (0 == getCheckedItemsCount(gvID))
            {
                msgWarning('没有选择记录');
                return false;
            }
            if (confimrMsg) {
                if (!confirm(confimrMsg)) {
                    return false;
                }
            }
            return true;
         }
    </script>
    <script language="javascript" type="text/javascript">
        // Note: rowindex 可能不会代表当前的行号，因为有行添加删除或移动的话则不行
        function onRowStatusChanged(chk, rowIndex) {
            var tr = chk.parentNode.parentNode;
            if (chk.checked) {
                tr.style.backgroundColor = "#d6e2f6";
            }
            else {
                tr.style.backgroundColor = "";
            }
        }
    </script>
    <script language="javascript" type="text/javascript">
        function editTask(id) {
            var url = "Task/EditTaskDlg.aspx?id=" + id.toString();
            window.parent.document.openDialog(url, "编辑任务", editTaskCallback, 600, 340);
        }
        function editTaskCallback(type, key, value) {
            if (type == 1) {
            }
        }
    </script>
    <style type="text/css">
    #gv th
    {
        border:none;
    }
    #gv td
    {
        border-top:none;
        border-left:none;
        border-right:none;
        border-bottom:solid 1px #EEEEEE;
    }
    .timestamp{font-size:10px; color:#888888;}
    #divSearch{border:2px solid #fcc400; height:auto; min-height:60px; padding:3px;}
    .searchCtrl{width:80px; float:left;}
    .schItem{width:230px; float:left; height:22px; line-height:22px;}
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div class="titleText">
        收件箱 <span style="font-size: 12px; font-weight: normal;">(新任务
        <asp:Label runat="server" ID="lblNewTaskCount" Text="0"></asp:Label>, 未完成
        <asp:Label runat="server" ID="lblTotal" Text="0"></asp:Label>)</span>
    </div>
    <div class="btdiv2">
        <asp:Button runat="server" ID="btnDelete" CssClass="input00" Text="删除" />
        <asp:DropDownList runat="server" ID="drpChangeStatus" AutoPostBack="True" 
            onselectedindexchanged="drpChangeStatus_SelectedIndexChanged">
            <asp:ListItem>标记为..</asp:ListItem>
            <asp:ListItem>未读</asp:ListItem>
            <asp:ListItem>未完成</asp:ListItem>
            <asp:ListItem>已完成</asp:ListItem>
        </asp:DropDownList>
        <asp:TextBox runat="server" ID="txtSearch"></asp:TextBox>
        <div class="right">
            <webdiyer:AspNetPager ID="pager" CssClass="pager" runat="server" CustomInfoHTML="%CurrentPageIndex%/%PageCount%页&nbsp;&nbsp;"
                CustomInfoSectionWidth="12%" CustomInfoTextAlign="Right" 
                FirstPageText="首页" LastPageText="末页"
                LayoutType="Table" NextPageText="下一页" NumericButtonCount="6" NumericButtonTextFormatString="[{0}]"
                PageSize="20" PagingButtonSpacing="2px" PrevPageText="上一页" ShowCustomInfoSection="Left"
                SubmitButtonText="转到" onpagechanged="pager_PageChanged">
            </webdiyer:AspNetPager>
        </div>
    </div>
    <div id="divSearch">
        
    </div>
    <div style="clear:both;"></div>
    <div class="tableContaner">
        <asp:GridView ID="gv" runat="server" CssClass="table2" AutoGenerateColumns="False">
            <Columns>
                <asp:TemplateField HeaderStyle-Width="20px" ItemStyle-HorizontalAlign="Center">
                    <HeaderTemplate>
                        <input type="checkbox" onclick="javascript:checkAll(this);" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:CheckBox runat="server" ID="chk" onclick='<%# "javascript:onRowStatusChanged(this, " + Container.DataItemIndex + ");"%>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="状态" HeaderStyle-Width="30px">
                    <ItemTemplate>
                        <img src="../images/task.png" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="来自用户" HeaderStyle-Width="60px">
                    <ItemTemplate>
                        <%# Eval("CaseIndex")%>
                        <br />
                        <span class="timestamp"><%# FormatDateTime(Eval("CreateDateTime"))%></span>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Subject" HeaderText="主题" />
            </Columns>
            <HeaderStyle CssClass="listhead" />
            <AlternatingRowStyle CssClass="alt" />
        </asp:GridView>
    </div>
        <div class="btdiv2">
            &nbsp;&nbsp;<div class="right">
            <webdiyer:AspNetPager ID="pager2" runat="server" CssClass="pager" CustomInfoHTML="%CurrentPageIndex%/%PageCount%页&nbsp;&nbsp;"
                CustomInfoSectionWidth="12%" CustomInfoTextAlign="Right" 
                FirstPageText="首页" LastPageText="末页"
                LayoutType="Table" NextPageText="下一页" NumericButtonCount="6" NumericButtonTextFormatString="[{0}]"
                PageSize="20" PagingButtonSpacing="2px" PrevPageText="上一页" ShowCustomInfoSection="Left"
                SubmitButtonText="转到" onpagechanged="pager2_PageChanged">
            </webdiyer:AspNetPager>
        </div>
    </div>
    <script language="javascript" type="text/javascript">
        getx("divSearch").style.display = "none";
    </script>
    </form>
</body>
</html>
